/*
 *  AudioUnitPlayer.h
 *  SoundController0002
 *
 *  Created by jiro on 10/07/04.
 *  Copyright 2010 jiro music. All rights reserved.
 *
 */

#pragma once

#include <AudioUnit/AudioUnit.h>

namespace sc
{
	typedef OSStatus(*AudioUnitRenderCallback)(
		void* inRefCon,
		AudioUnitRenderActionFlags* ioActionFlag,
		const AudioTimeStamp* inTimeStamp,
		UInt32 inBusNumber,
		UInt32 inNumberFrames,
		AudioBufferList* ioData );

	class AudioUnitPlayer
	{
	protected:

		AudioUnit audioUnit;

	public:

		AudioUnitPlayer( AudioUnitRenderCallback callback );

		virtual void Play( double time );
		
		virtual bool IsPlaying() const = 0; 

		virtual void Skip( double time ) = 0;
		
		virtual void Pause();

		virtual void Stop();

	};
}